package com.vx.vxbug.entities;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

@Entity
@Table(name = "users")
@SuppressWarnings("all")
@NamedQueries(value = {
        @NamedQuery(name = "User.getAllUsers", query = "SELECT i FROM User i"),
        @NamedQuery(name = "User.getUserByLogin", query = "SELECT i FROM User i WHERE i.login LIKE :login")})
public class User implements Serializable {

	private static final long serialVersionUID = 6844290410242995363L;
	@Id
	@GeneratedValue
	@Column(name = "user_id")
	private int id;
	private String name;
	private String login;
	private String password;
	private String role;
    private String email;

	public User(String login, String password, String name, String role, String email) {
		super();
		this.name = name;
		this.role = role;
		this.setPassword(password);
		this.setLogin(login);
        this.email = email;
	}

	public User() {
		super();
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getLogin() {
		return login;
	}

	public void setLogin(String login) {
		this.login = login;
	}

	public String getRole() {
		return role;
	}

	public void setRole(String role) {
		this.role = role;
	}

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }
}
